/**
 * Created by Administrator on 2017/7/8.
 */
var lily=[],
    tina=[],
    sx=false;
$.getJSON(getApi+"/api/getcategorytitle",function(data){
    lily=data.result;
    var arr =[];
    $(lily).each(function(){
        arr.push('<div class="panel-group" id="accordion">' +
            '<div class="panel panel-default">' +
            '<div class="panel-heading">' +
            '<h4 class="panel-title">' +
            '<div data-toggle="collapse" data-parent="#accordion"href="#collapseOne">'+
            this.title+
            '<span>↓</span>'+
            '</div>' +
            '</h4>' +
            '</div>' +
            '<div id="collapseOne" class="panel-collapse collapse in">' +
            '<div class="panel-body">' +
            '<div id="getLi"></div>' +
            '</div>' +
            '</div>' +
            '</div>' +
            '</div>')});
    $(".seach").html(arr.join(""));
    sx=true;
});
if(sx=true){
    $.getJSON(getApi+"/api/getcategory",function(data){
        tina=data.result;
        var arr =[];
        $(tina).each(function(){
            arr.push('<div class="container">' +
                '<div class="row" >' +
                '<div class="col-xs-6 col-sm-3" style="background-color: #dedef8; box-shadow: inset 1px -1px 1px #444, inset -1px 1px 1px #444;">' +
                '<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>' +
                '</div>' +
                '</div>' +
                '</div>')})
        $("#getLi").html(arr.join(""));
    });
}
$(function () { $('#collapseFour').collapse({
    toggle: false
})})